31. How many windows?

How many windows?

To implement a sliding window search, you need to decide what size window you want to search, where in the image you want to start and stop your search, and how much you want windows to overlap. So, let's try an example to see how many windows we would be searching given a particular image size, window size, and overlap.

Suppose you have an image that is 256 x 256 pixels and you want to search windows of a size 128 x 128 pixels each with an overlap of 50% between adjacent windows in both the vertical and horizontal dimensions. Your sliding window search would then look like this:

So, you searched 9 windows total in this case. Let's try a quick quiz!

sliding Window Search

Suppose you have an image that is 1280 x 960 pixels and you want to search the entire image using 64 x 64 pixel windows with 50% overlap between windows in both the vertical and horizontal directions. How many windows would you be searching total?

SOLUTION: 1131